<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:controls="clr-namespace:Chronos.Client.Win.Controls"
                    xmlns:theme="clr-namespace:Chronos.Client.Win.Themes"
                    xmlns:wpfshell="clr-namespace:Microsoft.Windows.Shell;assembly=Microsoft.Windows.Shell"
                    xmlns:converters="clr-namespace:Chronos.Client.Win.Converters"
                    xmlns:caliburn="http://www.caliburnproject.org"
                    xmlns:views="clr-namespace:Chronos.Client.Win.Views">

    <Style x:Key="BaseStyle" TargetType="{x:Type FrameworkElement}">
        <Setter Property="TextOptions.TextFormattingMode" Value="Display" />
        <Setter Property="TextOptions.TextRenderingMode" Value="ClearType" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="TextBlock.FontFamily" Value="{x:Static theme:FontsAndColors.FontFamily}" />
        <Setter Property="TextBlock.FontSize" Value="{x:Static theme:FontsAndColors.ContentFontSize}" />
        <Setter Property="Margin" Value="2" />
        <Setter Property="Control.Padding" Value="3" />
    </Style>

<!-- TextBlock ============================================================================================================== -->
    <Style TargetType="{x:Type ContentControl}" BasedOn="{StaticResource BaseStyle}">
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="VerticalAlignment" Value="Stretch" />
    </Style>
    

<!-- TextBlock ============================================================================================================== -->
    <Style x:Key="{x:Type TextBlock}" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource BaseStyle}">
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="Padding" Value="1" />
    </Style>

<!-- TextBox ================================================================================================================ -->
    <Style x:Key="{x:Type TextBox}" TargetType="{x:Type TextBox}" BasedOn="{StaticResource BaseStyle}">
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="MinWidth" Value="120"/>
        <Setter Property="Padding" Value="1" />
        <Setter Property="AllowDrop" Value="true"/>
        <Setter Property="Foreground" Value="#111111" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBox}">
                    <Border Name="Border" Background="#ffffff" BorderBrush="#999999" BorderThickness="1" >
                        <ScrollViewer x:Name="PART_ContentHost"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="BorderBrush" Value="#666666" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

<!-- TextBlock ============================================================================================================== -->
    
    
    <!-- TileButton ============================================================================================================= -->
    <Style TargetType="{x:Type controls:TileButton}" BasedOn="{StaticResource BaseStyle}">
        <Setter Property="Height" Value="120" />
        <Setter Property="Width" Value="140" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type controls:TileButton}">
                    <Border Name="Border" Background="{TemplateBinding Background}" >
                        <Border Background="{TemplateBinding Background}">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="*" />
                                </Grid.RowDefinitions>
                                <controls:BlurlessImage Grid.Row="0" Source="{TemplateBinding Icon}" Height="64" Width="64" />
                                <TextBlock Grid.Row="1" Text="{TemplateBinding Text}" HorizontalAlignment="Center" VerticalAlignment="Top" TextAlignment="Center"
                                           Foreground="{TemplateBinding Foreground}" TextTrimming="WordEllipsis" TextWrapping="Wrap" />
                            </Grid>
                        </Border>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Opacity" Value="0.7" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

<!-- BrowseFile ============================================================================================================= -->
    <Style TargetType="{x:Type controls:BrowseFile}" BasedOn="{StaticResource BaseStyle}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type controls:BrowseFile}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <TextBox Grid.Column="0" 
                                 Text="{Binding Path=Path, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}, UpdateSourceTrigger=PropertyChanged}"/>
                        <Button x:Name="BROWSE_BUTTON_PART" Grid.Column="1" Content="Browse" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

<!-- CheckBox =============================================================================================================== -->
    <Style TargetType="{x:Type CheckBox}" BasedOn="{StaticResource BaseStyle}">
        <Setter Property="HorizontalAlignment" Value="Center" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="FontFamily" Value="{x:Static theme:FontsAndColors.FontFamily}" />
        <Setter Property="FontSize" Value="{x:Static theme:FontsAndColors.ContentFontSize}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type CheckBox}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="3" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Border Grid.Column="0" BorderThickness="1" BorderBrush="#666666" Height="15" Width="15">
                            <Border Name="MarkerBorder" Background="#666666" Opacity="1" Margin="2" />
                        </Border>
                        <ContentPresenter Grid.Column="2" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="False">
                            <Setter TargetName="MarkerBorder" Property="Opacity" Value="0.01" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" Value="0.5" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

<!-- Button ================================================================================================================= -->
    <Style TargetType="{x:Type Button}" BasedOn="{StaticResource BaseStyle}">
        <Setter Property="Foreground" Value="#ffffff" />
        <Setter Property="Background" Value="{x:Static theme:FontsAndColors.NormalMainBrush}" />
        <Setter Property="VerticalAlignment" Value="Stretch" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="MinWidth" Value="80" />
        <Setter Property="Height" Value="23" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="FontFamily" Value="{x:Static theme:FontsAndColors.FontFamily}" />
        <Setter Property="FontSize" Value="{x:Static theme:FontsAndColors.ContentFontSize}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"
                            VerticalAlignment="{TemplateBinding VerticalAlignment}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}">
                        <ContentPresenter x:Name="ContentSite" VerticalAlignment="Center" HorizontalAlignment="Center" RecognizesAccessKey="True"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="{x:Static theme:FontsAndColors.LightMainBrush}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="#666666" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
<!-- ComnoBox =============================================================================================================== -->
    <Style x:Key="ComboBoxToggleButtonStyle" TargetType="{x:Type ToggleButton}">
        <Setter Property="Background" Value="{x:Static theme:FontsAndColors.NormalMainBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition Width="20" />
                        </Grid.ColumnDefinitions>
                        <Border x:Name="Border" Grid.ColumnSpan="2" Background="{TemplateBinding Background}"
                                    />
                        <Path x:Name="Arrow" Grid.Column="1" Fill="{x:Static theme:FontsAndColors.NeutralBrush}" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 0 0 L 4 4 L 8 0 Z"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="ToggleButton.IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="{x:Static theme:FontsAndColors.LightMainBrush}" />
                        </Trigger>
                        <Trigger Property="ToggleButton.IsChecked" Value="true">
                            <Setter TargetName="Arrow" Property="Data" Value="M 0 0 L 4 4 L 8 0 Z" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Arrow" Property="Fill" Value="{x:Static theme:FontsAndColors.DarkNeutralBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <ControlTemplate x:Key="ComboBoxTextBox" TargetType="TextBox">
        <Border x:Name="PART_ContentHost" Focusable="False" Background="{TemplateBinding Background}" />
    </ControlTemplate>

    <Style x:Key="{x:Type ComboBoxItem}" TargetType="ComboBoxItem">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Height" Value="25" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ComboBoxItem">
                    <Border Name="Border" Padding="3" SnapsToDevicePixels="true">
                        <ContentPresenter />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsHighlighted" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="{x:Static theme:FontsAndColors.LightMainBrush}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Border" Property="TextBlock.Foreground" Value="{x:Static theme:FontsAndColors.DarkNeutralBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="{x:Type ComboBox}" TargetType="ComboBox">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
        <Setter Property="MinWidth" Value="130"/>
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Height" Value="23"/>
        <Setter Property="Margin" Value="2" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ComboBox">
                    <Grid>
                        <ToggleButton Name="ToggleButton" Style="{StaticResource ComboBoxToggleButtonStyle}" Grid.Column="2" Focusable="false" 
                                      IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press" />
                        <ContentPresenter Name="ContentSite" TextBlock.Foreground="{x:Static theme:FontsAndColors.NeutralBrush}" 
                                          IsHitTestVisible="False" Content="{TemplateBinding SelectionBoxItem}" 
                                          ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" 
                                          ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" 
                                          Margin="3,3,23,3" VerticalAlignment="Center" HorizontalAlignment="Left" />
                        <Popup Name="Popup" Placement="Bottom" IsOpen="{TemplateBinding IsDropDownOpen}" AllowsTransparency="True" 
                               Focusable="False" PopupAnimation="Slide">
                            <Grid Name="DropDown" SnapsToDevicePixels="True" MinWidth="{TemplateBinding ActualWidth}" MaxHeight="{TemplateBinding MaxDropDownHeight}">
                                <Border x:Name="DropDownBorder" Background="{x:Static theme:FontsAndColors.NormalMainBrush}" />
                                <ScrollViewer Margin="0" SnapsToDevicePixels="True">
                                    <StackPanel TextBlock.Foreground="{x:Static theme:FontsAndColors.NeutralBrush}" IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
                                </ScrollViewer>
                            </Grid>
                        </Popup>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="HasItems" Value="false">
                            <Setter TargetName="DropDownBorder" Property="MinHeight" Value="95"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{x:Static theme:FontsAndColors.DarkNeutralBrush}"/>
                        </Trigger>
                        <Trigger Property="IsGrouping" Value="true">
                            <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                        </Trigger>
                        <Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="true">
                            <Setter TargetName="DropDownBorder" Property="Margin" Value="0,0,0,0"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
<!-- Expander =============================================================================================================== -->
    <Style TargetType="{x:Type Expander}" BasedOn="{StaticResource BaseStyle}">
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Expander}">
                    <ControlTemplate.Resources>
                        <Style x:Key="HeaderToggleButtonStyle" TargetType="{x:Type ToggleButton}">
                            <Setter Property="Cursor" Value="Hand" />
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="{x:Type ToggleButton}">
                                        <Border Name="Border" BorderBrush="#cccccc" BorderThickness="1">
                                            <Grid>
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="*" />
                                                    <ColumnDefinition Width="Auto" />
                                                </Grid.ColumnDefinitions>
                                                <Border Grid.ColumnSpan="2" Opacity="0.01" Background="#ffffff" />
                                                <ContentPresenter Grid.Column="0" />
                                                <Border Grid.Column="1" BorderBrush="#cccccc" BorderThickness="1,0,0,0" Background="#eeeeee" Height="25" Width="25">
                                                    <Path Name="arrow" HorizontalAlignment="Center" VerticalAlignment="Center"
                                                          Stroke="#FF666666" StrokeThickness="2" SnapsToDevicePixels="False" Data="M1,1L5,5 9,1"/>
                                                </Border>
                                            </Grid>
                                        </Border>
                                        <ControlTemplate.Triggers>
                                            <Trigger Property="ToggleButton.IsChecked" Value="true">
                                                <Setter TargetName="arrow" Property="Path.Data" Value="M1,4.5L4.5,1 8,4.5" />
                                            </Trigger>
                                            <Trigger Property="ToggleButton.IsMouseOver" Value="true">
                                                <Setter TargetName="Border" Property="Background" Value="#eeeeee" />
                                            </Trigger>
                                        </ControlTemplate.Triggers>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </ControlTemplate.Resources>
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"
                            Background="{TemplateBinding Background}">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <ToggleButton Grid.Row="0" Name="HeaderSite" Style="{StaticResource HeaderToggleButtonStyle}"
                                          Content="{TemplateBinding HeaderedContentControl.Header}" 
                                          ContentTemplate="{TemplateBinding HeaderedContentControl.HeaderTemplate}" 
                                          Foreground="{TemplateBinding Control.Foreground}" 
                                          HorizontalContentAlignment="{TemplateBinding Control.HorizontalContentAlignment}" 
                                          VerticalContentAlignment="{TemplateBinding Control.VerticalContentAlignment}" 
                                          IsChecked="{Binding Path=IsExpanded,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}" />
                            <Border Name="ContentBorder" Grid.Row="1" BorderBrush="#cccccc" BorderThickness="0">
                                <ContentPresenter Name="ExpandSite" Visibility="Collapsed"
                                              Focusable="False" HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}" 
                                              VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}" 
                                              Margin="{TemplateBinding Control.Padding}" />
                            </Border>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="Expander.IsExpanded" Value="True">
                            <Setter TargetName="ExpandSite" Property="UIElement.Visibility" Value="Visible" />
                            <Setter TargetName="ContentBorder" Property="Border.BorderThickness" Value="1,0,1,1" />
                        </Trigger>
                        <Trigger Property="UIElement.IsEnabled" Value="False">
                            <Setter Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" Property="Control.Foreground" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
<!-- ListView =============================================================================================================== -->
    <Style TargetType="{x:Type ListView}" BasedOn="{StaticResource BaseStyle}">
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="VerticalAlignment" Value="Stretch" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="BorderBrush" Value="#cccccc" />
        <Setter Property="Focusable" Value="False" />
    </Style>

<!-- ListBox =============================================================================================================== -->
    <Style TargetType="{x:Type ListBox}" BasedOn="{StaticResource BaseStyle}">
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="VerticalAlignment" Value="Stretch" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="BorderBrush" Value="#cccccc" />
        <Setter Property="Focusable" Value="False" />
    </Style>

<!-- TreeView =============================================================================================================== -->
    <Style TargetType="{x:Type TreeView}" BasedOn="{StaticResource BaseStyle}">
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="BorderBrush" Value="#cccccc" />
    </Style>

<!-- Window ================================================================================================================= -->
    <Style TargetType="{x:Type Window}" BasedOn="{StaticResource BaseStyle}">
        <Setter Property="Background" Value="#eeeeee" />
    </Style>
    
<!-- CustomWindow =========================================================================================================== -->
    <Style TargetType="{x:Type controls:CustomWindow}">
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="FontFamily" Value="{x:Static theme:FontsAndColors.FontFamily}" />
        <Setter Property="FontWeight" Value="{x:Static theme:FontsAndColors.ContentFontWeight}" />
        <Setter Property="FontSize" Value="{x:Static theme:FontsAndColors.ContentFontSize}" />
        <Setter Property="wpfshell:WindowChrome.WindowChrome">
            <Setter.Value>
                <wpfshell:WindowChrome CaptionHeight="32"
                                       ResizeBorderThickness="5"
                                       CornerRadius="0"
                                       GlassFrameThickness="0,0,0,1">
                </wpfshell:WindowChrome>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type controls:CustomWindow}">
                    <ControlTemplate.Resources>
                        <controls:ResizeBorderThicknessToCaptionMarginConverter x:Key="ResizeBorderThicknessToCaptionMarginConverter" />
                        <Style x:Key="CustomWindowControlButtonStyle" TargetType="{x:Type Button}">
                            <Setter Property="SnapsToDevicePixels" Value="True" />
                            <Setter Property="HorizontalAlignment" Value="Center"/>
                            <Setter Property="VerticalAlignment" Value="Top" />
                            <Setter Property="Focusable" Value="false" />
                            <Setter Property="Cursor" Value="Hand" />
                            <Setter Property="wpfshell:WindowChrome.IsHitTestVisibleInChrome" Value="True" />
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="{x:Type Button}">
                                        <Grid>
                                            <Border Name="Border" Background="#ffffff" Opacity="0.01" />
                                            <Border Margin="0" Padding="8">
                                                <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
                                            </Border>
                                        </Grid>
                                        <ControlTemplate.Triggers>
                                            <Trigger Property="IsMouseOver" Value="True">
                                                <Setter TargetName="Border" Property="Opacity" Value="1" />
                                            </Trigger>
                                        </ControlTemplate.Triggers>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </ControlTemplate.Resources>
                    <Border BorderThickness="1" BorderBrush="#666666" Background="#eeeeee"
                            Padding="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(wpfshell:WindowChrome.WindowChrome).ResizeBorderThickness}"
                            TextBlock.FontWeight="{x:Static theme:FontsAndColors.TitleFontWeight}" TextBlock.FontSize="{x:Static theme:FontsAndColors.TitleFontSize}">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <Border Grid.Row="0" Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(wpfshell:WindowChrome.WindowChrome).CaptionHeight}">
                                <Border.Margin>
                                        <MultiBinding Converter="{StaticResource ResizeBorderThicknessToCaptionMarginConverter}">
                                            <MultiBinding.Bindings>
                                                <Binding Path="(wpfshell:WindowChrome.WindowChrome).ResizeBorderThickness" RelativeSource="{RelativeSource TemplatedParent}" />
                                                <Binding Path="WindowState" RelativeSource="{RelativeSource TemplatedParent}" />
                                            </MultiBinding.Bindings>
                                        </MultiBinding>
                                </Border.Margin>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Grid.Column="1" Text="Chronos Profiler" VerticalAlignment="Center" HorizontalAlignment="Left" Foreground="#111111" Margin="5,0,0,0" />
                                    <Button Grid.Column="2" Style="{StaticResource CustomWindowControlButtonStyle}" Name="MinimizeButton">
                                        <controls:BlurlessImage Source="pack://application:,,,/Chronos.Client.Win;component/Images/CustomWindow/Minimize.png" />
                                    </Button>
                                    <Button Grid.Column="3" Style="{StaticResource CustomWindowControlButtonStyle}" Name="RestoreButton">
                                        <controls:BlurlessImage Source="pack://application:,,,/Chronos.Client.Win;component/Images/CustomWindow/Restore.png" />
                                    </Button>
                                    <Button Grid.Column="3" Style="{StaticResource CustomWindowControlButtonStyle}" Name="MaximizeButton">
                                        <controls:BlurlessImage Source="pack://application:,,,/Chronos.Client.Win;component/Images/CustomWindow/Maximize.png" />
                                    </Button>
                                    <Button Grid.Column="4" Style="{StaticResource CustomWindowControlButtonStyle}" Name="CloseButton">
                                        <controls:BlurlessImage Source="pack://application:,,,/Chronos.Client.Win;component/Images/CustomWindow/Close.png" />
                                    </Button>
                                </Grid>
                            </Border>
                            <Border Grid.Row="1">
                                <ContentPresenter Content="{TemplateBinding Content}" />
                            </Border>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


<!-- ImageButton ========================================================================================================= -->
    <Style TargetType="{x:Type controls:ImageButton}" BasedOn="{StaticResource BaseStyle}">
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type controls:ImageButton}">
                    <Grid Name="Content" Opacity="0.5">
                        <Border Background="#000000" Opacity="0.01" />
                        <controls:BlurlessImage Source="{TemplateBinding Source}" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="Content" Property="Opacity" Value="0.7" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


<!-- PanelContentControl ================================================================================================= -->
    <Style x:Key="PanelContentControlStyle" TargetType="{x:Type ContentControl}" BasedOn="{StaticResource BaseStyle}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ContentControl}">
                    <Border BorderThickness="1" BorderBrush="#cccccc" Background="#ffffff" 
                            HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <Border Grid.Row="0" BorderThickness="0,0,0,1" BorderBrush="#cccccc" Background="#f8f8f8">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Text="{Binding DataContext.DisplayName, RelativeSource={RelativeSource TemplatedParent}}" 
                                               Foreground="#000000" Margin="7,3,3,3" Grid.Column="0"
                                               FontSize="{x:Static theme:FontsAndColors.TitleFontSize}"
                                               FontFamily="{x:Static theme:FontsAndColors.FontFamily}"
                                               FontWeight="{x:Static theme:FontsAndColors.TitleFontWeight}"/>
                                </Grid>
                            </Border>
                            <Border Grid.Row="1" Padding="{TemplateBinding Padding}" >
                                <ContentPresenter HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
                            </Border>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
<!-- GridViewBase ======================================================================================================== -->
    <Style TargetType="{x:Type views:View}" BasedOn="{StaticResource BaseStyle}">
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="VerticalAlignment" Value="Stretch" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Focusable" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type views:View}">
                    <ContentControl x:Name="PanelContentControl">
                        <ContentPresenter HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
                    </ContentControl>
                    <ControlTemplate.Triggers>
                        <Trigger Property="DisplayPanel" Value="True">
                            <Setter TargetName="PanelContentControl" Property="Style" Value="{StaticResource PanelContentControlStyle}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

<!-- TabItemViewStyle ======================================================================================================= -->
    <Style TargetType="{x:Type views:TabItemView}" BasedOn="{StaticResource BaseStyle}">
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="VerticalAlignment" Value="Stretch" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
    </Style>
    
<!-- TabControlHeaderDataTempate ============================================================================================ -->
    <DataTemplate x:Key="TabViewHeaderDataTempate">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="0" Text="{Binding DisplayName}" />
            <controls:ImageButton Grid.Column="1" Height="20" Width="20" Command="{Binding CloseCommand}"
                                  Source="pack://application:,,,/Chronos.Client.Win;component/Images/CloseTab.png" />
        </Grid>
    </DataTemplate>
        
<!-- TabControlContentDataTempate =========================================================================================== -->
    <DataTemplate x:Key="TabViewContentDataTempate">
        <ContentControl caliburn:View.Model="{Binding}" />
    </DataTemplate>

<!-- MenuUserControlStyle =================================================================================================== -->
    <Style x:Key="MenuUserControlStyle" TargetType="{x:Type UserControl}" BasedOn="{StaticResource BaseStyle}">
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="VerticalAlignment" Value="Stretch" />
        <Setter Property="Height" Value="30" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="Background" Value="{x:Static theme:FontsAndColors.NormalMainBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type UserControl}">
                    <Border Background="{TemplateBinding Background}">
                        <!--<Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <Border Grid.Row="0" BorderThickness="0,0,0,1" BorderBrush="#cccccc" Background="#f8f8f8">
                                <TextBlock Text="{Binding DataContext.DisplayName, RelativeSource={RelativeSource TemplatedParent}}" Foreground="#000000" Margin="7,3,3,3"
                                           FontSize="{x:Static theme:FontsAndColors.TitleFontSize}"
                                           FontFamily="{x:Static theme:FontsAndColors.FontFamily}"
                                           FontWeight="{x:Static theme:FontsAndColors.TitleFontWeight}"
                                           TextOptions.TextFormattingMode="Display"
                                           TextOptions.TextRenderingMode="ClearType"/>
                            </Border>
                            <Border Grid.Row="1" Padding="{TemplateBinding Padding}" >
                                <ContentPresenter HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
                            </Border>
                        </Grid>-->
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

<!-- PanelUserControl =================================================================================================== -->
    <!--<Style x:Key="PanelUserControl" TargetType="{x:Type UserControl}" BasedOn="{StaticResource BaseStyle}">
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="VerticalAlignment" Value="Stretch" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type UserControl}">
                    <Border BorderThickness="1" BorderBrush="#cccccc" Background="#ffffff" 
                            HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <Border Grid.Row="0" BorderThickness="0,0,0,1" BorderBrush="#cccccc" Background="#f8f8f8">
                                <TextBlock Text="{Binding DataContext.DisplayName, RelativeSource={RelativeSource TemplatedParent}}" Foreground="#000000" Margin="7,3,3,3"
                                           FontSize="{x:Static theme:FontsAndColors.TitleFontSize}"
                                           FontFamily="{x:Static theme:FontsAndColors.FontFamily}"
                                           FontWeight="{x:Static theme:FontsAndColors.TitleFontWeight}"
                                           TextOptions.TextFormattingMode="Display"
                                           TextOptions.TextRenderingMode="ClearType"/>
                            </Border>
                            <Border Grid.Row="1" Padding="{TemplateBinding Padding}" >
                                <ContentPresenter HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
                            </Border>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>-->

    <!-- PanelContentControl =================================================================================================== -->
    <!--<Style x:Key="PanelContentControl" TargetType="{x:Type ContentControl}" BasedOn="{StaticResource BaseStyle}">
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="VerticalAlignment" Value="Stretch" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ContentControl}">
                    <Border BorderThickness="1" BorderBrush="#cccccc" Background="#ffffff" Padding="{TemplateBinding Padding}"
                            HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
                        <ContentPresenter HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>-->


</ResourceDictionary>
